package com.bjsxt.domain;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 开仓订单信息
 */
@ApiModel(description = "开仓订单信息")
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "forex_open_position_order")
public class ForexOpenPositionOrder {
    public static final String COL_ID = "id";
    public static final String COL_USER_ID = "user_id";
    public static final String COL_MARKET_ID = "market_id";
    public static final String COL_MARKET_NAME = "market_name";
    public static final String COL_COIN_ID = "coin_id";
    public static final String COL_TYPE = "type";
    public static final String COL_ACCOUNT_ID = "account_id";
    public static final String COL_ENTRUST_ORDER_ID = "entrust_order_id";
    public static final String COL_ORDER_ID = "order_id";
    public static final String COL_PRICE = "price";
    public static final String COL_NUM = "num";
    public static final String COL_LOCK_MARGIN = "lock_margin";
    public static final String COL_CLOSE_NUM = "close_num";
    public static final String COL_STATUS = "status";
    public static final String COL_LAST_UPDATE_TIME = "last_update_time";
    public static final String COL_CREATED = "created";
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.INPUT)
    @ApiModelProperty(value = "主键")
    private Long id;
    /**
     * 用户ID
     */
    @TableField(value = "user_id")
    @ApiModelProperty(value = "用户ID")
    private Long userId;
    /**
     * 交易对ID
     */
    @TableField(value = "market_id")
    @ApiModelProperty(value = "交易对ID")
    private Long marketId;
    /**
     * 交易对名称
     */
    @TableField(value = "market_name")
    @ApiModelProperty(value = "交易对名称")
    private String marketName;
    /**
     * 结算币种
     */
    @TableField(value = "coin_id")
    @ApiModelProperty(value = "结算币种")
    private Long coinId;
    /**
     * 持仓方向：1-买；2-卖
     */
    @TableField(value = "`type`")
    @ApiModelProperty(value = "持仓方向：1-买；2-卖")
    private Byte type;
    /**
     * 资金账户ID
     */
    @TableField(value = "account_id")
    @ApiModelProperty(value = "资金账户ID")
    private Long accountId;
    /**
     * 委托订单
     */
    @TableField(value = "entrust_order_id")
    @ApiModelProperty(value = "委托订单")
    private Long entrustOrderId;
    /**
     * 成交订单号
     */
    @TableField(value = "order_id")
    @ApiModelProperty(value = "成交订单号")
    private Long orderId;
    /**
     * 成交价格
     */
    @TableField(value = "price")
    @ApiModelProperty(value = "成交价格")
    private BigDecimal price;
    /**
     * 成交数量
     */
    @TableField(value = "num")
    @ApiModelProperty(value = "成交数量")
    private BigDecimal num;
    /**
     * 扣除保证金
     */
    @TableField(value = "lock_margin")
    @ApiModelProperty(value = "扣除保证金")
    private BigDecimal lockMargin;
    /**
     * 平仓量
     */
    @TableField(value = "close_num")
    @ApiModelProperty(value = "平仓量")
    private BigDecimal closeNum;
    /**
     * 状态：1：未平仓；2-已平仓
     */
    @TableField(value = "`status`")
    @ApiModelProperty(value = "状态：1：未平仓；2-已平仓")
    private Byte status;
    /**
     * 修改时间
     */
    @TableField(value = "last_update_time", fill = FieldFill.UPDATE)
    @ApiModelProperty(value = "修改时间")
    private Date lastUpdateTime;
    /**
     * 创建时间
     */
    @TableField(value = "created", fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间")
    private Date created;
}